﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.HotReloadDeserializer
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using UnityEngine.Bindings;

#nullable disable
namespace UnityEngine
{
  [NativeType(Header = "Runtime/Export/HotReload/HotReload.bindings.h")]
  [NativeConditional("HOT_RELOAD_AVAILABLE")]
  internal static class HotReloadDeserializer
  {
    [FreeFunction("HotReload::Prepare")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void PrepareHotReload();

    [FreeFunction("HotReload::Finish")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void FinishHotReload(System.Type[] typesToReset);

    [NativeThrows]
    [FreeFunction("HotReload::CreateEmptyAsset")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern Object CreateEmptyAsset(System.Type type);

    [FreeFunction("HotReload::DeserializeAsset")]
    [NativeThrows]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void DeserializeAsset(Object asset, byte[] data);

    [FreeFunction("HotReload::RemapInstanceIds")]
    [NativeThrows]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void RemapInstanceIds(
      Object editorAsset,
      int[] editorToPlayerInstanceIdMapKeys,
      int[] editorToPlayerInstanceIdMapValues);

    internal static void RemapInstanceIds(
      Object editorAsset,
      Dictionary<int, int> editorToPlayerInstanceIdMap)
    {
      HotReloadDeserializer.RemapInstanceIds(editorAsset, editorToPlayerInstanceIdMap.Keys.ToArray<int>(), editorToPlayerInstanceIdMap.Values.ToArray<int>());
    }

    [FreeFunction("HotReload::FinalizeAssetCreation")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void FinalizeAssetCreation(Object asset);

    [FreeFunction("HotReload::GetDependencies")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern Object[] GetDependencies(Object asset);

    [FreeFunction("HotReload::GetNullDependencies")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern int[] GetNullDependencies(Object asset);
  }
}
